import com.liu.lab10.dao.impl.UserDaoImpl;
import com.liu.lab10.service.impl.UserServiceImpl;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class test {
    public static void main(String[] args) {
//        获取配置文件
        ApplicationContext app = new ClassPathXmlApplicationContext("applicationContext.xml");
//        获取bean
        UserServiceImpl userService= (UserServiceImpl) app.getBean("userService");
        UserDaoImpl userDao= (UserDaoImpl) app.getBean("userDao");

        if(userService.login("23","userdao")){
            userService.info("23","userdao");

            System.out.println(userService.toString());
        }

        if(userDao.login("23","userDao")){
            userDao.info("23","userDao");
            System.out.println(userDao.toString());
        }

    }
}
